package net.aiform.pojo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

@Entity
@Table(name = "af_identity")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@TableGenerator(name = "af_identity_id", table = "af_key_generator", pkColumnName = "name", valueColumnName = "value", pkColumnValue = "af_identity_id", allocationSize = 1)
public class Identity implements Serializable {
	private static final long serialVersionUID = -263588341606902768L;
	@Id
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "af_identity_id")
	protected long id;
	protected String code;
	protected String name;
	protected Date createTime;
	protected Date expireTime;

	public Identity() {
		super();
		this.createTime = new Date();
	}

	public String getCode() {
		return code;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public Date getExpireTime() {
		return expireTime;
	}

	public long getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public void setExpireTime(Date expireTime) {
		this.expireTime = expireTime;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "Identity [code=" + code + ", createTime=" + createTime + ", expireTime=" + expireTime + ", id=" + id + ", name=" + name + "]";
	}

}
